<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j">
    <head>
        <title>TODO supply a title</title>
    </head>
    <body>
        <ui:composition>
            <style type="text/css">                
                input[type='submit']{
                    margin:3px 5px 3px 5px;
                    padding:2px 5px 2px 5px;
                }
                .rf-cal-inp {
                    width:100px;
                    margin-left: 2px;
                }
            </style>
            <h:form>
                <rich:panel styleClass="content-hight">
                    <h:panelGroup  id="curTab">
                        <rich:tabPanel rendered="#{paymentOrderBean.querybut}">
                            <rich:tab  header="查询条件" >
                                <h:panelGrid columns="4">                                    
                                    <h:outputLabel value="编号：" for="number"/>
                                    <h:inputText size="20" id="number" value="#{paymentOrderBean.queryCondition.number}"/>
                                    <h:outputLabel value="合同类型：" for="name"/>
                                    <h:inputText size="20" id="name" onclick="showContracttype()"
                                                 value="#{paymentOrderBean.queryCondition.contractType.name}"/>
                                    <h:outputLabel value="名称：" for="cname"/>
                                    <h:inputText size="20" id="cname" value="#{paymentOrderBean.queryCondition.cname}"/>
                                    <h:outputLabel value="地点：" for="address"/>
                                    <h:inputText size="20" id="address" value="#{paymentOrderBean.queryCondition.address}"/>
                                    <h:outputText value="签订日期："/>
                                    <h:panelGroup>
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.orderdatestart}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"  style="width:200px"/>
                                        至
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.orderdateend}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"  style="width:200px"/>
                                    </h:panelGroup>
                                    <h:outputText value="开始日期："/>
                                    <h:panelGroup>
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.startstart}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"  style="width:200px"/>
                                        至
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.startend}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"  style="width:200px"/>
                                    </h:panelGroup>
                                    <h:outputText value="截止日期："/>
                                    <h:panelGroup>
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.deadlinestart}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"  style="width:200px"/>
                                        至
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.deadlineend}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"  style="width:200px"/>
                                    </h:panelGroup>
                                    <h:outputText value="质保日期："/>
                                    <h:panelGroup>
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.warrantystart}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"
                                                       inputStyle="inputClass"/>
                                        至
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.warrantyend}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"  style="width:200px"/>
                                    </h:panelGroup>
                                    <h:outputLabel value="甲方：" for="nameA"/>
                                    <h:inputText size="20" id="nameA" value="#{paymentOrderBean.queryCondition.nameA}"/>
                                    <h:outputLabel value="甲方法人：" for="nameAstand"/>
                                    <h:inputText size="20" id="nameAstand" value="#{paymentOrderBean.queryCondition.nameAstand}"/>
                                    <h:outputLabel value="乙方：" for="nameB"/>
                                    <h:inputText size="20" id="nameB" value="#{paymentOrderBean.queryCondition.partner.name}"/>
                                    <h:outputLabel value="乙方法人：" for="nameBstand"/>
                                    <h:inputText size="20" id="nameBstand" value="#{paymentOrderBean.queryCondition.partner.legalPerson}"/>
                                    <h:outputLabel value="标的：" for="nameA"/>
                                    <h:panelGroup>
                                        <h:inputText size="20" id="targetstart" value="#{paymentOrderBean.queryCondition.targetstart}"/>
                                        -<h:inputText size="20" id="targetend" value="#{paymentOrderBean.queryCondition.targetend}"/>
                                    </h:panelGroup>
                                    <h:outputLabel value="质保金：" for="nameA"/>
                                    <h:panelGroup>
                                        <h:inputText size="20" id="quality_marginstart" value="#{paymentOrderBean.queryCondition.quality_marginstart}"/>
                                        -<h:inputText size="20" id="quality_marginend" value="#{paymentOrderBean.queryCondition.quality_marginend}"/>
                                    </h:panelGroup>
                                    <h:outputLabel value="违约金：" for="nameA"/>
                                    <h:panelGroup>
                                        <h:inputText size="20" id="penaltystart" value="#{paymentOrderBean.queryCondition.penaltystart}"/>
                                        -<h:inputText size="20" id="penaltyend" value="#{paymentOrderBean.queryCondition.penaltyend}"/>
                                    </h:panelGroup>
                                    <h:outputLabel value="其他事项：" for="other"/>
                                    <h:inputText size="20" id="other" value="#{paymentOrderBean.queryCondition.other}"/>

                                    <h:outputText value="付款计划："/>
                                    <h:panelGroup>
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.date1_start}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"
                                                       inputStyle="inputClass"/>
                                        至
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.date1_end}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"  style="width:200px"/>
                                    </h:panelGroup>                                    
                                </h:panelGrid>
                                <hr/>
                                <h:panelGrid columns="4">
                                    <h:outputLabel value="收付款日期：" for="payTime"/>
                                    <h:panelGroup id="payTime">
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.date2_start}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"
                                                       inputStyle="inputClass"/>
                                        至
                                        <rich:calendar value="#{paymentOrderBean.queryCondition.date2_end}"
                                                       locale="Locale.CHINA"
                                                       popup="true"
                                                       datePattern="yyyy-MM-dd"
                                                       showApplyButton="false"  style="width:200px"/>
                                    </h:panelGroup>

                                    <h:outputLabel value="收付款金额：" for="payAmount"/>
                                    <h:panelGroup id="payAmount">
                                        <h:inputText size="20" value="#{paymentOrderBean.queryCondition.payAmoutnStart}"/>
                                        -<h:inputText size="20" value="#{paymentOrderBean.queryCondition.payAmoutnEnd}"/>
                                    </h:panelGroup>
                                </h:panelGrid>
                                <h:inputHidden  id="code" value="#{paymentOrderBean.queryCondition.contractType.code}"/>
                            </rich:tab>
                        </rich:tabPanel>

                        <a4j:commandButton value="查询"
                                           action="#{paymentOrderBean.queryAllModel}"
                                           render="@this,tableGroup"
                                           onclick="this.disabled = 'true';">
                        </a4j:commandButton>
                        <a4j:commandButton value="取消" rendered="#{paymentOrderBean.querybut}"
                                           action="#{paymentOrderBean.queryCancel}"
                                           render="tableGroup,curTab"/>
                        <a4j:commandButton value="隐藏" rendered="#{paymentOrderBean.querybut}"
                                           action="#{paymentOrderBean.hiddenbut}"
                                           render="curTab"/>
                        <a4j:commandButton value="显示" rendered="#{!paymentOrderBean.querybut}"
                                           action="#{paymentOrderBean.showbut}"
                                           render="curTab"/>
                    </h:panelGroup>

                    <h:panelGroup id="tableGroup">
                        <rich:dataScroller for="tableEdit" execute="@this" render="tableGroup"/>
                        <div style="width:750px;overflow: auto;">
                            <rich:dataTable id="tableEdit"
                                            value="#{paymentOrderBean.allModel}" var="dataInput"
                                            rowClasses="list-row-odd,list-row-even"
                                            headerClass="table-header"
                                            rows="6"
                                            style="width:100%;margin-bottom:5px;"
                                            noDataLabel="无数据">
                                <f:facet name="header">
                                    <h:outputText value="付款单" />
                                </f:facet>

                                <rich:column style="width:50px;text-align:center;">
                                    <h:commandLink value="选择"
                                                   action="#{paymentOrderBean.rowSelected}"/>
                                </rich:column>

                                <rich:column>
                                    <f:facet name="header">
                                        <h:panelGroup>
                                            <h:outputText value="合同编号"/>
                                        </h:panelGroup>
                                    </f:facet>
                                    <h:outputText  value="#{dataInput.mainInfo.number}" />
                                </rich:column>

                                <rich:column>
                                    <f:facet name="header">
                                        <h:panelGroup>
                                            <h:outputText value="合同名称"/>
                                        </h:panelGroup>
                                    </f:facet>
                                    <h:outputText  value="#{dataInput.mainInfo.cname}" />
                                </rich:column>

                                <rich:column>
                                    <f:facet name="header">
                                        <h:panelGroup>
                                            <h:outputText value="对方单位"/>
                                        </h:panelGroup>
                                    </f:facet>
                                    <h:outputText  value="#{dataInput.mainInfo.partner.name}" />
                                </rich:column>

                                <rich:column>
                                    <f:facet name="header">
                                        <h:panelGroup>
                                            <h:outputText value="标的"/>
                                        </h:panelGroup>
                                    </f:facet>
                                    <h:outputText  value="#{dataInput.mainInfo.target}" />
                                </rich:column>

                                <rich:column style="text-align:right;">
                                    <f:facet name="header">
                                        <h:panelGroup>
                                            <h:outputText value="付款金额"/>
                                        </h:panelGroup>
                                    </f:facet>
                                    <h:outputText  value="#{dataInput.amount}"/>
                                </rich:column>
                                <f:facet name="footer"></f:facet>
                            </rich:dataTable>

                            <rich:jQuery selector="#tableEdit tr:odd" query="addClass('odd-row')" />
                            <rich:jQuery selector="#tableEdit tr:even" query="addClass('even-row')" />
                            <rich:jQuery selector="#tableEdit tr"
                                         query="mouseover(function(){jQuery(this).addClass('active-row')})"/>
                            <rich:jQuery selector="#tableEdit tr"
                                         query="mouseout(function(){jQuery(this).removeClass('active-row')})"/>
                        </div>
                    </h:panelGroup>

                </rich:panel>
            </h:form>
        </ui:composition>
    </body>
</html>
